package com.qiandw.enterprise.credit.utils

import java.security.MessageDigest

import sun.misc.BASE64Encoder

/**
  * Created by Draven on 2018/7/13.
  * Email:hjx@qiandw.com
  */
object Md5Util {

  def md5(plainStr: String): String = {
    val md5 = MessageDigest.getInstance("MD5")
    val base64en = new BASE64Encoder
    val encryptStr = base64en.encode(md5.digest(plainStr.getBytes("utf-8")))
    encryptStr.toUpperCase
  }
}
